import fetch from '../utils/fetch'
import config from '../utils/config'
import { querystring } from 'vux'
var InviteBidAskService = {
  getInviteBidAsk (providerGUID, inviteBidGUID) {
    var data = {
      action: 'GetInviteBidAsk', // 在线澄清
      ProviderGUID: providerGUID,
      InviteBidGUID: inviteBidGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url
    })
  },
  getInviteBidAskDetail (providerGUID, inquiryGUID) {
    var data = {
      action: 'GetInviteBidAskDetail', // 在线澄清详情
      ProviderGUID: providerGUID,
      InquiryGUID: inquiryGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax'
    return fetch({
      url: url,
      params: data
    })
  },
  getInviteBid (inviteBidGUID) {
    var data = {
      action: 'GetInviteBid', // 获取发标信息
      InviteBidGUID: inviteBidGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url
    })
  },

  submitInviteBidAsk: function (inviteBidQuestionData) {
    inviteBidQuestionData.action = 'SubmitInviteBidAsk'// 提交澄清
    var url = config.API_SERVER + '/WXApi.ajax'
    return fetch({
      url: url,
      method: 'POST',
      data: querystring.stringify(inviteBidQuestionData),
      headers: {'Content-Type': 'application/x-www-form-urlencoded'}
    })
  },
  GetInviteBidAskAll (providerGUID) {
    var data = {
      action: 'GetInviteBidAskAll', // 获取发标信息
      ProviderGUID: providerGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url
    })
  }
}

export default InviteBidAskService
